home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 4_7.lha / 4_7 / 4_7d.c < prev    next >
Text File  |  1993-08-08  |  476b  |  24 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <tnode.h>
  6. include <stream.h>
  7. / print a node's value sorted between
  8. / its left and right subtrees
  9. tatic void aprnode(tnode *leaf)
  10.  
  11.    if (leaf)
  12.        {
  13. aprnode(leaf->left);
  14. cout << leaf->tword << "\n";
  15. aprnode(leaf->right);
  16. }
  17.  
  18.  
  19. / print out the tree alphabetically
  20. oid aprinttree(tree treeheadptr)
  21.  
  22.    aprnode(*treeheadptr);
  23.  
  24.